// import axios from '@/utils/request'
export default {
  StoreStock: {
    entity: { name: 'Stock', prefix: () => `store/${localStorage.getItem('storeId')}` },
    list: {
      export: {
        query: {
          '@display': `{
            'stock' : 'entity.getSpecification().getName()',
            'remains' : 'entity.getRemains()',
            'threshold' : 'entity.getThreshold()'
          }`,
          limit: 10000000
        },
        label: {
          'stock': '产品',
          'remains': '当前库存',
          'threshold': '预警值'
        }
      },
      list_filter: {
        'specification.product.name': '产品'
      },
      list_display: [
        {
          property: 'material',
          label: '物料'
        },
        'remains',
        {
          property: 'currentSingleCost',
          label: '成本单价',
          editable: true
        },
        {
          property: 'threshold',
          label: '预警库存'
        }
      ]
    },
    form: {
      fields: [
        {
          property: 'material',
          field_options: {
            label: '物料'
          }
        },
        {
          property: 'currentSingleCost',
          field_options: { label: '成本单价' },
          help: '成本单价会根据入库单进行加权平均计算'
        },
        {
          property: 'threshold',
          field_options: {
            label: '预警库存'
          }
        }
      ]
    }
  }
}

